package com.wanrue.tcc.repository;

import com.wanrue.tcc.context.Transaction;
import com.wanrue.tcc.context.Xid;
import com.wanrue.tcc.enums.Result;
import com.wanrue.tcc.recover.RecoveryInfo;

import java.util.List;

/**
 * 事务信息持久化接口
 * Created by changmingxie on 11/12/15.
 */
public interface Repository {

    int delete();

    Transaction findByXid(Xid xid);

    int create(Transaction transaction);

    int update(Transaction transaction);

    List<RecoveryInfo> findAllUnmodifiedSince();

    int update(Transaction transaction, Result result);
}
